package blogger.client.eventqueqe.events;

import blogger.client.eventqueqe.handlers.TwitAddingHandler;
import blogger.client.model.entity.Message;

import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.EventHandler;

/**
 * Created by IntelliJ IDEA.
 * User: mega
 * Date: 31.12.2009
 * Time: 3:25:09
 * To change this template use File | Settings | File Templates.
 */
public class TwitAddedEvent extends GwtEvent<TwitAddingHandler>{

    public static final Type<TwitAddingHandler> TYPE = new Type<TwitAddingHandler>();

    private Message message;

    @Override
    public Type<TwitAddingHandler> getAssociatedType() {
        return TYPE;  
    }

    @Override
    protected void dispatch(TwitAddingHandler handler) {
        handler.onTwitAdded(this);
    }

    public Message getMessage() {
        return message;
    }

    public TwitAddedEvent(Message message) {
        super();
        this.message = message;
    }
}
